<template>
    <div class="chart-box">
        <div class="title">发表调研的文章</div>
        <div :class="`clound c-${Math.abs(1 - index) % 7 +1}`"><span>商事</span><span>审判指导</span></div>
        <div :class="`clound c-${Math.abs(2 - index) % 7 +1}`">人民司法</div>
        <div :class="`clound c-${Math.abs(3 - index) % 7 +1}`">中国审判</div>
        <div :class="`clound c-${Math.abs(4 - index) % 7 +1}`">人民法院报</div>
        <div :class="`clound c-${Math.abs(5 - index) % 7 +1}`">法制日报</div>
        <div :class="`clound c-${Math.abs(6 - index) % 7 +1}`">人民法院<span>案例选</span></div>
        <div :class="`clound c-${Math.abs(7 - index) % 7 +1}`">民事审判<span>指导与参考</span></div>
    </div>
</template>

<script>

export default {
    name: "PublishArticle",
    data() {
        return {
            index: 0,
            inter:null
        }
    },
    mounted() {
        this.inter =setInterval(() => {
            this.index--
        }, 3000);
    },
    beforeDestroy(){
        this.inter && clearInterval(this.inter)
    }
}
</script>

<style lang="less" scoped>
.chart-box {
    flex: 1;
    display: flex;
    align-items: center;
    height: 100%;
    justify-content: center;
    position: relative;

    .title {
        font-size: 24px;
        text-align: center;
        font-weight: 400;
        color: #FFFFFF
    }

    .clound {
        font-size: 18px;
        line-height: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        flex-direction: column;
        font-size: 18px;
        line-height: 20px;
        color: #0179E8;
        background: url(../../../assets/yun.png);
        background-size: cover;
        background-repeat: no-repeat;
        width: 154px;
        height: 88px;
        transition: all 1s;
        padding: 10px 0 0;
    }


    .c-1 {
        top: 30px;
        left: 45px;
    }

    .c-2 {
        top: 0;
        left: 202px;
    }

    .c-3 {
        top: 26px;
        left: calc(100% - 63px - 154px);
    }

    .c-4 {
        top: 124px;
        left:calc(100% - 154px);
    }

    .c-5 {
        top: calc(100% - 88px);
        left:calc(100% - 154px - 123px);
    }

    .c-6 {
        top: calc(100% - 88px);
        left: 141px;
    }

    .c-7 {
        top: 132px;
        left: 0;
    }
}
</style>